﻿using Dapper;
using System;
using BCEntity.TMS.WorkingCompany;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Threading.Tasks;

namespace BCData.TMS.WorkingCompany
{
	/// <summary>
	/// 劳务公司
	/// </summary>
	public interface IWorkingCompanyData
	{
		#region  成员方法
		/// <summary>
		/// 是否存在该记录
		/// </summary>
		/// <param name="workingCompanyId">劳务公司Id</param>
		Task<bool> Exists(long workingCompanyId);
		/// <summary>
		/// 增加劳务公司
		/// </summary>
		/// <param name="entity">劳务公司信息</param>
		Task<WorkingCompanyEntity> Add(WorkingCompanyEntity entity);
		/// <summary>
		/// 更新劳务公司
		/// </summary>
		/// <param name="entity">劳务公司信息</param>
		Task<WorkingCompanyEntity> Update(WorkingCompanyEntity entity);
		/// <summary>
		/// 删除劳务公司
		/// </summary>
		/// <param name="workingCompanyId">劳务公司Id</param>
		Task<bool> Delete(long workingCompanyId);
		/// <summary>
		/// 获取劳务公司
		/// </summary>
		/// <param name="workingCompanyId">劳务公司Id</param>
		Task<WorkingCompanyEntity> GetEntity(long workingCompanyId);
		/// <summary>
		/// 获取劳务公司分页列表
		/// </summary>
		/// <param name="companyId">公司Id</param>
		/// <param name="departmentId">部门Id</param>
		/// <param name="workingCompanyName">劳务公司名字</param>
		/// <param name="start">开始时间</param>
		/// <param name="end">结束时间</param>
		/// <param name="sortName">排序字段</param>
		/// <param name="ascending">升序</param>
		/// <param name="pageIndex">当前页码</param>
		/// <param name="pageSize">每页数据条数</param> 
		Task<(IEnumerable<WorkingCompanyEntity>, int)> Query(int? companyId, long? departmentId, string workingCompanyName, DateTime? start, DateTime? end, string sortName, bool? ascending, int pageIndex, int pageSize);


		/// <summary>
		/// 获取劳务公司列表
		/// </summary>
		/// <param name="companyId">公司Id</param>
		/// <param name="departmentId">部门Id</param>
		/// <param name="workingCompanyName">劳务公司名字</param>
		/// <returns></returns>
		Task<IEnumerable<WorkingCompanyEntity>> GetOnlyList(int? companyId, long? departmentId, string workingCompanyName);
		/// <summary>
		/// 根据区县编码获取劳务公司列表
		/// </summary>
		/// <param name="countyCode">区县编码</param>
		/// <returns></returns>
		Task<IEnumerable<WorkingCompanyEntity>> GetListByCountyCode(string countyCode);
        #endregion  成员方法
    }


}